﻿using UnityEngine;
namespace Project
{
    public class Bullet : BaseBullet
    {
        public float CriticalHit;  //暴击几率
        public float subSpeed; //攻击到敌人减速参数
        public float subSpeedTime;//持续时间

        protected override void Attack(Collider2D collision)
        {
            if (collision.CompareTag("Enemy"))
            {
                //进行伤害计算
                float d = Random.Range(0f, 1f);
                if (d < CriticalHit)  //触发暴击
                {

                }
                else//没触发暴击
                {

                }
                // collision.GetComponent<EnemyRetard>().StartRetard(subSpeed, subSpeedTime);
                Destroy(gameObject);
            }
        }
    }
}

